﻿#coding: utf-8

require 'dm-validations'
require 'dm-types'
require 'json'

class Thematic
	include DataMapper::Resource

	property :id, Serial
	property :label, String, :required => true
	property :url, FilePath, :required => true
	has n, :node


	def to_json(*a)
		{
			'id' => id.to_i,
			'label' => label.to_s,
			'url' => url.to_s
		}.to_json(*a)
	end
end
